﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EntityFrameworkContrib.PostSharp4EF;
using EditableBusinessObjects.Postsharp.Public;
using System.Runtime.Serialization;


namespace EFContrib.PS4EF.Tst.RelationShipType
{

    [Poco("SimpleRelationshipTestEntities")]
    [CyclicReferences.Public.CreateSerializeSurrogate("EntityFrameworkContrib.PostSharp4EF.ISerializationHelp, EntityFrameworkContrib.PostSharp4EF")]
    [DataContract(Namespace = "myNamespace", Name = "Car")]
    public class Car
    {
        [DataMember]
        public int CarID { get; set; }
        [DataMember]
        public string Make { get; set; }

        [DataMember]
        public Customer Customer { get; set; }

    }

    [Poco("SimpleRelationshipTestEntities")]
    [CyclicReferences.Public.CreateSerializeSurrogate("EntityFrameworkContrib.PostSharp4EF.ISerializationHelp, EntityFrameworkContrib.PostSharp4EF")]
    [DataContract(Namespace = "myNamespace", Name = "Order")]
    public class Order
    {
        [DataMember]
        public int OrderID { get; set; }
        [DataMember]
        public int Amount { get; set; }

        [DataMember]
        public Customer Customer { get; set; }

    }


    [Poco("SimpleRelationshipTestEntities")]
    [CyclicReferences.Public.CreateSerializeSurrogate("EntityFrameworkContrib.PostSharp4EF.ISerializationHelp, EntityFrameworkContrib.PostSharp4EF")]
    [DataContract(Namespace = "myNamespace", Name = "Customer")]
    public class Customer
    {
        [DataMember]
        public int CustomerID { get; set; }
        [DataMember]
        public string Name { get; set; }

        [DataMember]
        public ICollection<Car> Cars { get; set; }

        [DataMember]
        public ICollection<Order> Orders { get; set; }
    }








    //[CyclicReferences.Public.CreateSerializeSurrogate(typeof(IEditableBusinessObject))]
    //[EditableBusinessObjects.Postsharp.Public.EditableBusinessObject]
    //[Serializable]
    //[DataContract(Namespace = "myNamespace", Name = "Car")]
    //public class CarClient
    //{
    //    [DataMember]
    //    public int CarID { get; set; }
    //    [DataMember]
    //    public string Make { get; set; }

    //    [DataMember]
    //    public CustomerClient Customer { get; set; }

    //}

    //[CyclicReferences.Public.CreateSerializeSurrogate(typeof(IEditableBusinessObject))]
    //[EditableBusinessObjects.Postsharp.Public.EditableBusinessObject]
    //[Serializable]
    //[DataContract(Namespace = "myNamespace", Name = "Order")]
    //public class OrderClient
    //{
    //    [DataMember]
    //    public int OrderID { get; set; }
    //    [DataMember]
    //    public int Amount { get; set; }

    //    [DataMember]
    //    public CustomerClient Customer { get; set; }
    //}


    //[CyclicReferences.Public.CreateSerializeSurrogate(typeof(IEditableBusinessObject))]
    //[EditableBusinessObjects.Postsharp.Public.EditableBusinessObject]
    //[Serializable]
    //[DataContract(Namespace = "myNamespace", Name = "Customer")]
    //public class CustomerClient
    //{
    //    [DataMember]
    //    public int CustomerID { get; set; }
    //    [DataMember]
    //    public string Name { get; set; }

    //    [DataMember]
    //    public ICollection<CarClient> Cars { get; set; }

    //    [DataMember]
    //    public ICollection<OrderClient> Orders { get; set; }
    //}



}